package com.group.medical.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class PageData<T> {
    private Integer code;
    private String msg;
    private long total;
    private long pages;
    private List<T> data;

    public static <T> PageData<T> ok(long total,long pages,List<T> data){
        return new PageData(0,"分页请求成功",total,pages,data);
    }

    public static <T> PageData<T> fail(){
        return new PageData(0,"分页请求失败",0, 0, null);
    }
}